package io;

import java.io.*;

public class CopyDemo3 {
    public static void main(String[] args) throws IOException {
        FileInputStream fit = new FileInputStream("hanku_cp.jpg");
        BufferedInputStream bit = new BufferedInputStream(fit);
        FileOutputStream fot = new FileOutputStream("hanku_cp2.jpg");
        BufferedOutputStream bot = new BufferedOutputStream(fot);
        int d;
        long sta = System.currentTimeMillis();
        while ((d = bit.read())!= -1 ){
            bot.write(d);
        }
        long end = System.currentTimeMillis();
        System.out.println("复制完毕耗时：" + (end - sta));
        bit.close();
        bot.close();


    }
}
